package com.bang.sgg.springboot02mybatis.controller;

import com.bang.sgg.springboot02mybatis.persist.model.Robot;
import com.bang.sgg.springboot02mybatis.persist.model.mapper.RobotMapperExt;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @ClassName: RobotController
 * @author: BANG
 * @Date: 2019/11/20 14:12
 * @Version: 1.0
 * @Modified By:
 * @Desc: TODO
 */
@RestController
public class RobotController {


    @Autowired
    private RobotMapperExt robotMapperExt;


    @GetMapping("/insert")
    public Object insert(Robot robot) {
        int insertInto = robotMapperExt.insertInto(robot);
        return robot;
    }

    @GetMapping("/selectOne")
    public Object selectOne(Long robotId) {
        return robotMapperExt.selectOne(robotId);
    }


    @GetMapping("/deleteOne")
    public Object deleteOne(Long robotId) {
        return robotMapperExt.deleteOne(robotId);
    }

    @GetMapping("/updateOne")
    public Object updateOne(Robot robot) {
        return robotMapperExt.updateOne(robot);
    }

}
